<html>
<head><meta charset="utf-8"><title>keeping dependencies for `cargo install` · t-cargo · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/index.html">t-cargo</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/keeping.20dependencies.20for.20.60cargo.20install.60.html">keeping dependencies for `cargo install`</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="229318846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/keeping%20dependencies%20for%20%60cargo%20install%60/near/229318846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/keeping.20dependencies.20for.20.60cargo.20install.60.html#229318846">(Mar 08 2021 at 15:41)</a>:</h4>
<p>Sometimes <code>cargo install</code> fails (maybe some arbitrary system dependency is not installed, for example). Is there a way to keep the build directory around, so that I don't have to rebuild all 100+ successful dependencies?</p>



<a name="229320760"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/keeping%20dependencies%20for%20%60cargo%20install%60/near/229320760" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hyd-dev <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/keeping.20dependencies.20for.20.60cargo.20install.60.html#229320760">(Mar 08 2021 at 15:53)</a>:</h4>
<p>I think Cargo keeps it by default? I just encountered the issue, and Cargo printed to the screen that the target directory had not been deleted and the path to it (<code>/tmp/...</code>). I passed the path with <code>--target-dir</code> to the second <code>cargo install</code> run, and it seems not rebuilding the successful dependencies. (Note that you have to delete the directory manually after the second (successful) <code>cargo install</code>.)</p>



<a name="229321009"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/keeping%20dependencies%20for%20%60cargo%20install%60/near/229321009" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/keeping.20dependencies.20for.20.60cargo.20install.60.html#229321009">(Mar 08 2021 at 15:55)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116155">Jake Goulding</span> <a href="#narrow/stream/246057-t-cargo/topic/keeping.20dependencies.20for.20.60cargo.20install.60/near/229318846">said</a>:</p>
<blockquote>
<p>Sometimes <code>cargo install</code> fails (maybe some arbitrary system dependency is not installed, for example). Is there a way to keep the build directory around, so that I don't have to rebuild all 100+ successful dependencies?</p>
</blockquote>
<p>you can set CARGO_TARGET_DIR to an absolute path</p>



<a name="229321968"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/keeping%20dependencies%20for%20%60cargo%20install%60/near/229321968" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/keeping.20dependencies.20for.20.60cargo.20install.60.html#229321968">(Mar 08 2021 at 16:00)</a>:</h4>
<p>Thanks!</p>



<a name="229324706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/keeping%20dependencies%20for%20%60cargo%20install%60/near/229324706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hyd-dev <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/keeping.20dependencies.20for.20.60cargo.20install.60.html#229324706">(Mar 08 2021 at 16:09)</a>:</h4>
<p><span class="user-mention silent" data-user-id="374396">hyd-dev</span> <a href="#narrow/stream/246057-t-cargo/topic/keeping.20dependencies.20for.20.60cargo.20install.60/near/229320760">said</a>:</p>
<blockquote>
<p>I think Cargo keeps it by default? I just encountered the issue, and Cargo printed to the screen that the target directory had not been deleted and the path to it (<code>/tmp/...</code>). I passed the path with <code>--target-dir</code> to the second <code>cargo install</code> run, and it seems not rebuilding the successful dependencies. (Note that you have to delete the directory manually after the second (successful) <code>cargo install</code>.)</p>
</blockquote>
<p><a href="https://github.com/rust-lang/cargo/blob/970bc67c3775781b9708c8a36893576b9459c64a/src/cargo/ops/cargo_install.rs#L355">https://github.com/rust-lang/cargo/blob/970bc67c3775781b9708c8a36893576b9459c64a/src/cargo/ops/cargo_install.rs#L355</a></p>



<a name="229325660"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/keeping%20dependencies%20for%20%60cargo%20install%60/near/229325660" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/keeping.20dependencies.20for.20.60cargo.20install.60.html#229325660">(Mar 08 2021 at 16:13)</a>:</h4>
<p>"inspect" doesn't immediately scream "reuse". Wonder if <code>cargo install</code> should say "rerun the command with ... to resume once you've fixed things"</p>



<a name="229326325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/keeping%20dependencies%20for%20%60cargo%20install%60/near/229326325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/keeping.20dependencies.20for.20.60cargo.20install.60.html#229326325">(Mar 08 2021 at 16:15)</a>:</h4>
<p><span class="user-mention silent" data-user-id="374396">hyd-dev</span> <a href="#narrow/stream/246057-t-cargo/topic/keeping.20dependencies.20for.20.60cargo.20install.60/near/229320760">said</a>:</p>
<blockquote>
<p>I just encountered the issue</p>
</blockquote>
<p>Do you happen to recall what you did? I want to document this properly, but I don't have a command at-hand that will fail to install.</p>



<a name="229327040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/keeping%20dependencies%20for%20%60cargo%20install%60/near/229327040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> hyd-dev <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/keeping.20dependencies.20for.20.60cargo.20install.60.html#229327040">(Mar 08 2021 at 16:18)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116155">Jake Goulding</span> <a href="#narrow/stream/246057-t-cargo/topic/keeping.20dependencies.20for.20.60cargo.20install.60/near/229326325">said</a>:</p>
<blockquote>
<p>Do you happen to recall what you did? I want to document this properly, but I don't have a command at-hand that will fail to install.</p>
</blockquote>
<p>I tried to install <code>wasmer-cli</code> with <code>llvm</code> feature, and I didn't have LLVM installed properly.</p>



<a name="229329709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/keeping%20dependencies%20for%20%60cargo%20install%60/near/229329709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/keeping.20dependencies.20for.20.60cargo.20install.60.html#229329709">(Mar 08 2021 at 16:28)</a>:</h4>
<p>Thanks! Turns out I had LLVM well-enough installed, so I went with diesel, which tries to use mysql by default. Created <a href="https://stackoverflow.com/q/66533502/155423">How can I avoid rebuilding dependencies when <code>cargo install</code> fails due to a system configuration issue?</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>